#include <iostream>
using namespace std;
bool isGood(int x) {
  for (int i = 1; x; i++, x /= 10) {
    if (x % 2 != i % 2) return false;
  }
  return true;
}
int main() {
  int N;
  cin >> N;
  int cnt = 0;
  for (int i = 1; i <= N; ++i) cnt += isGood(i);
  cout << cnt << endl;
}